package me.huanmeng.heater.heather;

import me.huanmeng.heater.bot.MessageHelper;
import me.huanmeng.heater.command.Command;
import me.huanmeng.heater.event.Event;
import me.huanmeng.heater.object.ChannelInfo;
import me.huanmeng.heater.object.Guild;
import me.huanmeng.heater.object.UserInfo;
import me.huanmeng.heater.plugin.Plugin;
import me.huanmeng.heater.sender.Channel;
import me.huanmeng.heater.sender.CommandSender;
import me.huanmeng.heater.sender.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;

/**
 * 2021/10/1<br>
 * Heater<br>
 *
 * @author huanmeng_qwq
 */
public interface Server extends MessageHelper {
    /**
     * 名字
     *
     * @return 名字
     */
    String getName();

    /**
     * 获取这个服务器的版本
     *
     * @return 版本
     */
    String getVersion();

    @NotNull <T extends Event> T callEvent(@NotNull T event);

    void registerEvents(Plugin plugin, @NotNull Object listener);

    @Nullable
    Channel getChannel(@NotNull String id);

    void setChannel(@NotNull ChannelInfo channel);

    @Nullable
    User getUser(@NotNull String id);

    void setUser(@NotNull UserInfo userInfo);

    void executeCommand(@NotNull CommandSender sender, @Nullable Channel channel, @NotNull String line);

    void registerCommand(@NotNull Plugin plugin, @NotNull Command command);

    Guild getGuild(String id);

    void setGuild(Guild guild);

    Collection<Guild> getGuilds();

    UserInfo getUserInfo(String id);
}
